import HttpClient from '../utils/request';

import type { classificationReqType,classificationResType,classificationDetailsReqType,classificationFormReqType,classificationResDataType} from './../types/classificationType';

// 获取分类列表
export const getClassificationList = (e: classificationReqType) => {
    console.log(e)
    return HttpClient.request<classificationResType>({
        url: '/platform/category/getCategoryList',
        method: "POST",
        data: e,
        headers: {
            "Content-type": "application/json"
        }
    });
}
// 获取分类详情
export const getClassificationDetail = (e:classificationDetailsReqType) => {
    return HttpClient.request<classificationResDataType>({
        url: '/platform/category/getCategoryDetail',
        method: "POST",
        data: e,
        headers: {
            "Content-type": "application/json"
        }
    });
}
// 新增分类
export const createClassification = (e:classificationFormReqType) => {
    return HttpClient.request({
        url: '/platform/category/createCategory',
        method: "POST",
        data: e,
        headers: {
            "Content-type": "application/json"
        }
    });
}
// 编辑分类
export const updateClassification = (e:classificationFormReqType) => {
    return HttpClient.request({
        url: '/platform/category/updateCategory',
        method: "POST",
        data: e,
        headers: {
            "Content-type": "application/json"
        }
    });
}

// 删除分类
export const deleteClassification = (e:classificationDetailsReqType) => {
    return HttpClient.request({
        url: '/platform/category/deleteCategory',
        method: "POST",
        data: e,
        headers: {
            "Content-type": "application/json"
        }
    });
}




